<?php
//--------------------------------------------------
//	Filename: groups_show.php
//--------------------------------------------------
if( !defined('IN_INDEX') )
{
	printError("ACCESS DENIED", "This page is hidden.");
	exit;
}
if(!checkSession())
{
			function redirect($url)
			{
			?>
				<script type="text/javascript">
					{
					window.location = "<?=$url?>";
					}
				</script>
			<?php 
			}
			redirect("index.php?action=login");
	exit;
}
?>
<div id='postpath'>
		<a title="<?php echo translate('gotofrontpage'); ?>" href="index.php"><?php echo translate('home'); ?></a>
		&gt; <a href="index.php?action=groups" title='<?php echo translate('groups'); ?>'><?php echo translate('groups'); ?></a> 
        &gt; <a href="index.php?action=groups&amp;sub=show&amp;gid=<?php echo $_REQUEST['gid']; ?>"><?php echo getGroupName($_REQUEST['gid']); ?></a>
</div>

<!-- Left column START -->
<div class="leftcol">

	<!-- Profile pic START-->
	<div style="text-align: center;">
		<?php
		echo "<img src='./img/groups.jpg' width='150' alt='" . translate('profile_picture_group') . "' /></a>";
		?>
	</div>
  <!-- Profile pic END-->
    
    <br />
    <b><?php echo ucf(translate('coach')); ?></b>
	<br />
	<?php echo "<a style='color:#555555;' href='index.php?action=profile&amp;id=". getGroupAdmin(getGroupName($_REQUEST['gid'])) ."'>" .getNameFromId(getGroupAdmin(getGroupName($_REQUEST['gid']))) . "</a>"; ?>
    <br />
    <br />
    <b><?php echo ucf(translate('description')); ?></b>
    <br />
    <?php echo nl2br(wordwrap(getGroupDescription($_REQUEST['gid']), 25)); ?>
    <br />
    <br />
    <b><?php echo ucf(translate('privacy')); ?></b>
    <br />
    <?php
	$group_privacy = getGroupPrivacy($_REQUEST['gid']);
	if($group_privacy == "open")
	{
		echo ucf(translate('open'));
	}
	elseif($group_privacy == "closed")
	{
		echo ucf(translate('closed'));
	}
	elseif($group_privacy == "secret")
	{
		echo ucf(translate('secret'));
	}
	?>
    <br />
    
    <div style="clear: both;">
    
     <div style="clear: both;"></div>

    <br />

    <?php
	echo "<a href='index.php?action=groups&amp;sub=members'><div style='float: left; clear: right; padding-right: 5px;'><img src='img/user_friends.png' /></div> " . translate('showallmembers') . "</a> (11)<br />";
	?>
    <div style="clear: both;"></div>

		<?php
		$checkmemberstatus = checkIfuserIsMember($USER->getId(),getGroupName($_REQUEST['gid']));
		if($checkmemberstatus == 0)
		{   
			echo "<a href=\"index.php?action=groups&amp;sub=show&amp;gid=". $_REQUEST['gid'] ."&amp;request=" . $_REQUEST['gid'] . "\"><div style='float: left; clear: right; padding-right: 5px;'><img src='img/user_add.png' /></div>" . translate('send_group_request') . "</a>";
		}
		else
		{
			echo "<a href=\"index.php?action=groups&amp;sub=show&amp;gid=". $_REQUEST['gid'] ."&amp;decline=" . $_REQUEST['gid'] . "\"><div style='float: left; clear: right; padding-right: 5px;'><img src='img/user_delete.png' /></div>" . translate('send_group_decline') . "</a>";
		}
		?>
    </div>
	
    
</div>
<!-- Left column END -->

<!-- Center column START -->
<div class="midcol">

    <h1><?php echo getGroupName($_REQUEST['gid']); ?></h1>

    <br />
   
<div class="post">
   <div class="info">
    <div class="fixed"></div>


		<div class="content">
          Innhold

		</div>
		<div class="fixed"></div>
	</div>
</div> 
</div>